<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>list</title>
</head>
<body>
<div id="content">
    <h3 class="admin_link_bar">
        <jsp:include page="inc.jsp"></jsp:include>
    </h3>
    <table width="800" cellspacing="0" cellPadding="0" id="listTable" border="1">
        <tr>
            <td colspan="5">
                <form action="/admin/user/list">
                    请输入查询用户名或者昵称：<input type="text" name="con" value="${con}"/><input type="submit" value="查询"/>
                </form>
            </td>
        </tr>
        <tr>
            <td>用户标识</td>
            <td>用户名称</td>
            <td>用户昵称</td>
            <td>用户状态</td>
            <td>用户操作</td>
        </tr>


        <c:if test="${pagers.totalPage le 0 }">
            <tr>
                <td colspan="5">目前还没有用户数据</td>
            </tr>
        </c:if>
        <c:if test="${pagers.totalPage gt 0}">
            <c:forEach items="${pagers.datas}" var="user">
                <tr>
                    <td>${user.id }</td>
                    <td><a href="${user.id }" class="list_link">${user.username}</a></td>
                    <td>${user.nickname }&nbsp;</td>
                    <td>
                        <c:if test="${user.status eq true }">
                            <span style='color:red'>停用</span>
                            <%--<span  class="emp">停用</span>--%>
                            <a href="updateStatus/${user.id }" class="list_op">启用</a>
                        </c:if>
                        <c:if test="${user.status eq false }">
                            <span>启用</span>
                            <a href="updateStatus/${user.id }" class="list_op">停用</a>
                        </c:if>
                        &nbsp;
                    </td>
                    <td>
                        <a href="update/${user.id }" class="list_op">更新</a>
                        &nbsp;
                        <a href="listRes/${user.id }" class="list_op">查询管理资源</a>
                    </td>
                </tr>
            </c:forEach>
            <tr>
                <td colspan="5">
                    <jsp:include page="/jsp/pager.jsp">
                        <jsp:param value="list" name="url"/>
                        <jsp:param value="${pagers.totalPage }" name="items"/>
                        <jsp:param value="con" name="params"/>
                    </jsp:include>
                </td>
            </tr>
        </c:if>

    </table>
</div>
</body>
</html>